package cn.ainit.base.modify;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.ainit.bs.entity.Operators;
import cn.ainit.sys.common.dao.SysBaseDao;


@Repository
@Transactional
public class ModifyDao extends  SysBaseDao{
   
	
	//查询用户信息
	public List getUserInfo(String sql) throws Exception{
		
		List list=jdbcTemplate.queryForList(sql);
		
		return list;
	}
  //对数据进行修改
	public boolean getSaveOrUpdate(Operators operators) {
         try {
        	  getSessionFactory().getCurrentSession().saveOrUpdate(operators);
        	  return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
           
		return false;
	}
	//用sql语句进行修改
	public boolean getjdbcUpdateBysql(String updateSql) {
         try {
			  jdbcTemplate.execute(updateSql);
			  
        	  return  true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return false;
	}

}
